<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddColumnUserChapterWords251007 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //订单表
        Schema::table('user_chapter_word', function (Blueprint $table){
            $table->date('date')->default('2025-10-01')->comment('日期');

            $table->index(['date', 'book_id']);
            $table->index(['book_id']);
        });

        //用户表
        Schema::table('users', function (Blueprint $table){
            $table->index(['auth_target_id', 'auth_type']);
        });

        Schema::table('orders', function (Blueprint $table){
            $table->date('date')->default('2025-10-01')->comment('日期');

            $table->index(['date', 'book_id']);
            $table->index(['book_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
